package com.huangsm.book.designmodel;

import java.lang.reflect.Proxy;

/**
 * @author huang
 * @PACKAGE_NAME com.huangsm.book.designmodel
 * @PROJECT_NAME concurrence
 * @date 2019/2/15
 */
public class TestCreateJdkProxy {
    public static void main(String[] args) {
        //测试生成jdk动态代理类
        IDKQuery jdkProxy= (IDKQuery) Proxy.newProxyInstance(
                ClassLoader.getSystemClassLoader(),new Class[]{IDKQuery.class},
                new JdkDbQueryHandler()
        );
        System.out.println(jdkProxy);
        IDKQuery cglibProxy = CglibDbQueryProxy.createCglibProxy();
        System.out.println(cglibProxy);
    }
}
